#ifndef SVMCLASSIFYKERNELS
#define SVMCLASSIFYKERNELS

#include "../common/framework.h"

__global__ void makeSelfDots(float* devSource, int devSourcePitchInFloats, float* devDest, int sourceCount, int sourceLength);

__global__ void makeDots(float* devDots, int devDotsPitchInFloats, float* devSVDots, float* devDataDots, int nSV, int nPoints);

__device__ void computeKernels(float* devNorms, int devNormsPitchInFloats, float* devAlphas, int nPoints, int kernelType, int nSV, float coef0, int degree,  float* localAlphas, float* localNorms, int* localFlags);

__device__ void reduce(float mapAValue, float mapBValue, float* localValue, int outputIndex);

template<unsigned int blockSize> __global__ void computeKernelsReduce(float* devNorms, int devNormsPitchInFloats, float* devAlphas, int devAlphaPitchInFloats, int nSV, float* result, int resultPitch, float* rho);

template<KernelType K> __global__ void computeK(float* devNorms, int devNormsPitchInFloats, int nSV, float coef0, float degree);

template<bool binary> __global__ void argmax(float* devResult, int devResultPitchInFloats, int nPointsInSlice, int ntasks);

template<unsigned int blockSize> __device__ void sumWarpReduce(volatile float* localValue, unsigned int tid);

#endif
